Skip to content

[Refactor/#82] 예외 처리 내부 구조 변경#83

Merged
ThirFir merged 2 commits intodevelopfrom
refactor/#82-error-architecture
Apr 29, 2025
Merged

[Refactor/#82] 예외 처리 내부 구조 변경#83
ThirFir merged 2 commits intodevelopfrom
refactor/#82-error-architecture

Conversation

@ThirFir
Copy link
Copy Markdown
Collaborator

@ThirFir ThirFir commented Apr 28, 2025

🧨 Issue

💻 Work Description

  • Response Parsing 인터셉터 제거
  • Call Adapter를 활용한 에러 처리 구조로 수정

@ThirFir ThirFir added the REFACTOR🔃 전면 수정 label Apr 28, 2025
@ThirFir ThirFir self-assigned this Apr 28, 2025
Copy link
Copy Markdown
Member

@1971123-seongmin 1971123-seongmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다

404 -> "Not Found: 요청한 리소스를 찾을 수 없습니다."
in 500 until 600 -> "Internal Server Error: 서버 내부 오류입니다."
else -> "Unknown Error: 알 수 없는 오류입니다."
}
Copy link
Copy Markdown
Member

@1971123-seongmin 1971123-seongmin Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 RemoteError.kt를 사용하는 구조로 변경했을 때 실제 동작에서의 차이도 있을까요??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아뇨 차이없습니당.
클래스 구조를 좀 더 효율적으로 변경하였습니다.

override fun responseType(): Type = responseType

override fun adapt(call: Call<R>): Call<R> {
return object : Call<R> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 Call을 사용하신 이유가 궁금합니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어떤 이유라기 보다는 CallAdapter를 확장할 때, 타입으로 원래 Call를 지정해주어야 하는 것으로 알고 있습니다.

if (response.isSuccessful) {
if (response.body() != null)
callback.onResponse(call, response)
else {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기에서 response의 body가 null이라는 것은 홈 화면의 가게 리스트가 emptyList 이런 것이 아닌 body자체가 null이란 뜻인건가요??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 body가 null이라서 정상적인 상황은 아님을 나타냅니다.

@ThirFir ThirFir merged commit 82b5205 into develop Apr 29, 2025
@ThirFir ThirFir deleted the refactor/#82-error-architecture branch April 29, 2025 20:01
ThirFir added a commit that referenced this pull request May 1, 2025
[Mod/#83] 네비게이션 구조 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REFACTOR🔃 전면 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 예외 처리 내부 구조 수정

2 participants